﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Planisoft.Entities;

namespace Planisoft.DAO
{
    public class MesDAO : MasterDataAcces , IMesDAO
    {

        public List<Mes> GetAllFromMes()
        {
            var query = from m in Context.Meses
                        orderby m.IdMes
                        select m;
            return query.ToList();
        }


        public List<Mes> GetAllFromMesAfp()
        {
            var query = from ma in Context.Meses
                            where!(from vl in Context.ValoresRegPensionarios select vl.IdRP).Contains(ma.IdMes)
                            select ma; 
            return query.ToList();

        }


        public List<Mes> GetAllFromMesPlanilla()
        {
            var query = from mp in Context.Meses
                            where!(from pl in Context.PlanillaCabeceras select pl.PeriodoMes).Contains(mp.IdMes)
                            select mp;
            return query.ToList();
        }
    }
}
